<template>
  <div class="btn-round" @click="backIndex">
    返回<br>{{this.isBack ? '投票' : '顶部'}}
  </div>
</template>
<script>
export default {
  props: {
    isBack: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
    }
  },
  methods: {
    backIndex() {
      if (this.isBack) {
        this.$router.push('/?catid=' + this.$route.query.catid)
      } else {
        window.scrollTo(0, 0)
      }

    }
  }
}
</script>
<style lang='scss' scoped>
</style>
